<!DOCTYPE html>
<html>
<head>
  <title>分类</title>
  {include file="public/head" /}
</head>
<body>
<div class="wrapper" >

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" style="background: #fff">
 

    <!-- Main content -->
    <section class="content container-fluid" >

      <div class="row" >
        <div class="col-xs-12">
             <!-- form start -->
            <form id="attrForm" action="{:url('Department/getdata')}" class="form-horizontal">
            <input type="hidden" name="category_id" value="{$data.category_id}">
            <input type="hidden" id="parentId" value="{$data.parent_id}">
            <input type="hidden" id="demo" name="remark" value="">
              <div class="box-body">
                <div class="form-group">
                  <label for="inputEmail3" class="col-sm-2 control-label">分类名称</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="category_name" value="{$data.category_name}">
                  </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">上级分类</label>
                    <div class="col-sm-10">
                        <select class="form-control select2" id="settype" name="parent_id" style="width: 100%;">
                            <option value="0">一级分类</option>
                            {foreach name="list" item="vo"}
                              <option value="{$vo.category_id}">{$vo.category_name}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">关键字</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="seo_keywords" value="{$data.seo_keywords}" placeholder="SEO优化">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">描述</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="seo_description" value="{$data.seo_description}" placeholder="SEO优化">
                  </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">标题</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="seo_title" value="{$data.seo_title}" placeholder="SEO优化">
                  </div>
                </div>
                <div class="form-group">
                    <label for="inputEmail3" class="col-sm-2 control-label">发布状态</label>
                    <div class="col-sm-10">
                        <select class="form-control select2" id="status" name="status" style="width: 100%;">
                            <option value="0">发布</option>
                            <option value="1">不发布</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                  <label for="inputPassword3" class="col-sm-2 control-label">排序</label>

                  <div class="col-sm-10">
                    <input type="text" class="form-control" name="category_sort" value="{$data.category_sort}">
                  </div>
                </div>
              </div>
            </form>
        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
</div>
<!-- ./wrapper -->
{include file="public/js" /}
<script type="text/javascript">
//根据需要填写需要的模块
function confirm() {
    return $("#attrForm").serialize();
} 

window.onload=function(){
    var typeId =document.getElementById("parentId").value;
    var opttype=document.getElementById("settype").children;
    //菜单父级
    var optValue=typeId;//这是已知的值
    for(var opt in opttype){
        if(opttype[opt].value==optValue){
            opttype[opt].selected="selected";
            // return;
        }
    }
}
</script>
</script>
</body>
</html>